<template>
     <!-- 添加等级 -->
    <div class="aaview">
        <div class="head">
            <span>分销商等级>添加等级 </span>
        </div>
        <div class="head1">
                <div class="head1-x">等级信息</div>
                <div class="information">
                    <div class="information-x">
                        <span>*</span>
                        选择等级
                    </div>
                    <div class="information-y">
                        <div :class="{active:aa==1}" @click="xuan(1)">一级</div>
                        <div :class="{active:aa==2}" @click="xuan(2)">二级</div>
                        <div :class="{active:aa==3}" @click="xuan(3)">三级</div>
                    </div>
                </div>
                <div class="information">
                    <div class="information-x">
                        <span>*</span>
                        等级名称
                    </div>
                    <input type="text" class="information-xx" v-model="inputval" @change="input">
                    <span class="zia">{{value}}/8</span>
                </div>
        </div>
        <div class="head2">
                <div class="head1-x">等级佣金</div>
                <div class="head2-x">
                    <div>
                        <span>*</span>
                        一级分销佣金
                    </div>
                    <input type="text">
                    <div class="head2-x-a">%</div>
                </div>
                <div class="head2-x">
                    <div>
                        <span>*</span>
                       二级分销佣金
                    </div>
                    <input type="text">
                    <div class="head2-x-a">%</div>
                </div>
                <div class="head2-x">
                    <div>
                        <span>*</span>
                        三级分销佣金
                    </div>
                    <input type="text">
                    <div class="head2-x-a">%</div>
                </div>
        </div>
        <div class="head3">
                <div class="head1-x">等级提升</div>
                <div class="upgradation">
                    <span>自动升级</span>
                    <div class="mb-2 flex items-center text-sm">
                        <el-radio-group v-model="radio1" class="ml-4" >
                        <el-radio label="允许" size="large">允许自动升级</el-radio>
                        <el-radio label="禁止" size="large">禁止自动升级</el-radio>
                        </el-radio-group>
                        <span class="dong">选择允许自动升级后，将在用户等级中心显示等级的升级条件和佣金比例</span>
                    </div>
                </div>
                <div class="upgradation">
                    <span>升级条件</span>
                    <div class="mb-2 flex items-center text-sm">
                        <el-radio-group v-model="radio2" class="ml-4" >
                        <el-radio label="允许" size="large">满足以下任意条件</el-radio>
                        <el-radio label="禁止" size="large">满足以下全部条件</el-radio>
                        </el-radio-group>
                    </div>
                </div>
                <div class="condition">
                    <div class="condition-x">
                        <el-checkbox v-model="checked1" label="当前下线数" size="large" />
                        <input type="text">
                        <div>人</div>
                    </div>
                    <div class="condition-x">
                        <el-checkbox v-model="checked2" label="累计销售金额" size="large" />
                        <input type="text">
                        <div>元</div>
                    </div>
                    <div class="condition-x">
                        <el-checkbox v-model="checked3" label="累计佣金" size="large" />
                        <input type="text">
                        <div>元</div>
                    </div>
                </div>
        </div>
        <button class="bu1" @click="baocun">保存</button>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';

const inputval=ref() //输入框的值
const value=ref(0)// 输入框计算字数的
const aa=ref(1) //动态类
const radio1=ref('允许')//单选框
const radio2=ref('允许')//单选框
const checked1=ref(false) //多选框
const checked2=ref(false)//多选框
const checked3=ref(false)//多选框
const router=useRouter() //路由跳转的
const input=(()=>{
    let a=inputval.value.length
    value.value=a
})
const xuan=((obj:any)=>{
    aa.value=obj
})

const baocun=(()=>{
    router.push({
        path:"/Grade"
    })
})
</script>

<style scoped lang="less">
.active{
    background-color: #ed742f;
    color: white;
    border:1px solid #ed742f !important;
}
.aaview{
    width: 100%;
    height: 100%;
    background-color: #f2f2f2;
}
.head{
    width: 100%;
    height: 40px;
    background-color: white;
    span{
        margin-left: 10px;
        line-height: 40px;
        font-size: 14px;
    }
}
.head1{
    margin-top: 20px;
    background-color: rgb(255, 255, 255);
    width: 100%;
    height:230px;
    box-sizing: border-box;
    padding: 10px;
}
.head1-x{
    border-left: 5px solid #ed742f;
    padding-left: 10px;

}
.information{
    display: flex;
    margin-top: 20px;
    span{
        color: red;
    }
}
.information-x{
        color: #999999;
        margin: 10px 20px 0 20px ;
    
}
.information-y{
    margin-top: 7px;
    display: flex;
    div{
        border: 1px solid black;
        width: 70px;
        height: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20px;
        font-size: 14px;
        cursor: pointer;
    }
}
.information-xx{
    width: 200px;
    margin-top: 5px;
    height: 30px;
    // position: absolute;
}
.zia{
    position: relative;
    top:12px;
    left:-30px;
    color: black !important;
}
// 二级
.head2{
    width: 100%;
    height: 230px;
    background-color: white;
    margin-top: 10px;
    box-sizing: border-box;
    padding: 10px;
}
.head2-x{
    display: flex;
    font-size: 14px;
    color: #999999;
    height: 30%;
    align-items: center;
    margin-left: 20px;
    input{
        width: 150px;
        height: 15px;
        margin-left: 30px;
    }
    span{
        color: red;
    }
}
.head2-x-a{
    border: 1px solid black;
    border-left: 0px;
    width: 25px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

// 等级提升
.head3{
    width: 100%;
    height: 288px;
    background-color: white;
    margin-top: 10px;
    box-sizing: border-box;
    padding: 10px;
}
.upgradation{
    display: flex;
    height: 50px;
    align-items: center;
    margin-left: 20px;
    position: relative;
    span{
        color: #999999;
        margin-right: 20px;
        font-size: 14px;
    }
    .dong{
        position: absolute;
        left: 76px;
        top:35px;
        font-size: 12px;
    }
}
// 多条件
.condition{
    display: flex;
    flex-direction: column;
    margin-left: 95px;
}
.el-checkbox.el-checkbox--large{
    width: 120px !important;
}
.condition-x{
    display: flex;
    input{
        width: 160px;
        height: 30px;
    }
    div{
        border: 1px solid black;
        border-left: 0px;
        width: 30px;
        height: 35px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        color: #999999;
    }
}
.bu1{
    width: 130px;
    height: 40px;
    color: white;
    background-color: #ed742f;
    border-radius: 5px ;
    border: 0;
    margin-top: 20px;
}
</style>